package process

import "errors"

func (p *Process2)Stop(key string)error{
	process := p.GetProcess(key)
	if process == nil{
		return errors.New("进程不存在")
	}
	process.Status = 1
	if err := process.Pointer.Process.Kill();err != nil{
		return err
	}
	return nil
}
